home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / ultmtpch.lha / UPS / Sources / ups.i < prev   
Text File  |  1995-09-23  |  11KB  |  349 lines

  1.     IFND    UPS_I
  2. UPS_I    SET    1
  3. **
  4. **    $VER: ups.i 39.0 (17.06.95)
  5. **
  6. **    Structures and constants for Ultimate Patch System.
  7. **
  8. **    (C) Copyright 1994-1995 Glenz Points.
  9. **        All Rights Reserved
  10. **
  11.  
  12.     incdir    'include:'
  13.     include    "exec/types.i"
  14.     include    "exec/ports.i"
  15.  
  16.  
  17.  
  18. ***
  19. ***  Patcher file structure
  20. ***
  21.  
  22.  STRUCTURE pfs,32
  23.     LONG  pfs_ControlLong        ; must be equal to ControlLong
  24.     APTR  pfs_Next            ; pointer to next patcher
  25.     APTR  pfs_Prev            ; pointer to prev patcher
  26.     LONG  pfs_NeedVersion        ; minimum version of UPS to start
  27.     LONG  pfs_UsedVersion        ; version of UPS which was used
  28.                     ; while patcher was developed
  29.     APTR  pfs_PatcherName        ; pointer to name of patcher
  30.     LONG  pfs_Version            ; version
  31.     APTR  pfs_CoderName            ; pointer to name of programmer
  32.     APTR  pfs_VersionString        ; pointer to $VER: string
  33.     APTR  pfs_PatcherIDString        ; listview entry
  34.     LONG  pfs_Flags            ; flags
  35.     LONG  pfs_Status            ; status of flags
  36.     APTR  pfs_ExecBase            ; exec base
  37.     APTR  pfs_IntBase            ; intuition base
  38.     APTR  pfs_GadTBase            ; gadtools base
  39.     APTR  pfs_DosBase            ; dos base
  40.     APTR  pfs_GfxBase            ; graphics base
  41.     APTR  pfs_CxBase            ; commodities base
  42.     APTR  pfs_LayBase            ; layers base
  43.     APTR  pfs_UPSBase            ; UPS lib base
  44.     FPTR  pfs_Init            ; pointer to init routine
  45.     FPTR  pfs_Exit            ; pointer to exit routine
  46.     FPTR  pfs_Prefs            ; pointer to prefs routine
  47.     APTR  pfs_PrefsKey                  ; pointer to cx keys to call
  48.                                         ; prefs rout
  49.     APTR  pfs_ListPtr            ; pointer to structure of requested
  50.                         ; opened resources
  51.     APTR  pfs_Patch            ; pointer to structure for patches
  52.     APTR  pfs_pls            ; pointer to pls structure
  53.     APTR  pfs_UPSMsgPort        ; pointer to main UPS msg port
  54.     APTR  pfs_UPSRexxPort        ; pointer to rexx port
  55.     APTR  pfs_pxs            ; pointer to pxs structure
  56.     APTR  pfs_fakesemaphore        ; pointer to bool, TRUE for UPS's
  57.                     ; setfunction
  58.     LONG  pfs_User1            ;
  59.     LONG  pfs_User2            ;
  60.     LONG  pfs_ControlLong2        ; ControlLong
  61.     APTR  pfs_PFS            ; pointer to the beginning of struct
  62.     LABEL pfs_SIZEOF
  63.  
  64. pfsControlLong            equ    $17061995
  65. UPSMainVersion            equ    39
  66. UPSMainRevision            equ    0
  67. pfsPatcherStringLen    equ    25
  68. pfsPatchLinkStringLen   equ     27
  69. pfsPatcherStartupLen    equ     31
  70. pfsOffsetLen            equ     26
  71. pfsStartupCycleLen      equ     29
  72. pfsLibOverviewLen       equ     38
  73. pfsPMListviewLen        equ     16
  74. pfsOldNewLen            equ      9
  75. pfsPurposeLen           equ     16
  76. pfsLOPatcherStrLen      equ     16
  77.  
  78. pfsDisableable    equ    $00000001    ; Enable disable patcher option
  79. pfsPrefs    equ    $00000002    ; Prefs editor exists
  80. pfsNoRemoveable equ     $00000004       ; Disable Removing of Patcher
  81.  
  82.  
  83. ***
  84. ***  Patcher Extended Structure
  85. ***
  86.  
  87.  STRUCTURE pxs,0
  88.     LONG  pxs_CxID                      ; Commodity hotkey id
  89.     APTR  pxs_CsObjs                    ; Commodity object pointer
  90.     LABEL pxs_SIZEOF
  91.  
  92.  
  93. ***
  94. ***  Version strcuture
  95. ***
  96.  
  97.  STRUCTURE PVS,0
  98.     WORD  PVS_Version            ; version word
  99.     BYTE  PVS_Revision            ; revision byte
  100.     BYTE  PVS_User1            ;
  101.     LABEL PVS_SIZEOF
  102.  
  103.  
  104.  
  105. ***
  106. ***  Open Resource List
  107. ***
  108.  
  109.  STRUCTURE orl,0
  110.     APTR  orl_Next            ; pointer to next entry
  111.     APTR  orl_Prev            ; pointer to previous entry
  112.     LONG  orl_Type            ; type of resource
  113.     LONG  orl_ID            ; resource id
  114.     LONG  orl_Flags                     ; flags
  115.     APTR  orl_Name            ; pointer to name of resource
  116.     APTR  orl_Base            ; base of opened resource
  117.     LONG  orl_Version                   ; version, if needed
  118.     STRUCT orl_DataRegs,4*8        ; ...to put in data regs
  119.     FPTR  orl_Open            ; user open rout for user type
  120.     FPTR  orl_Close            ; user close rout for user type
  121.     APTR  orl_UTName            ; pointer to name for user type
  122.     LONG  orl_User1            ;
  123.     LONG  orl_User2            ;
  124.     LABEL orl_SIZEOF
  125.  
  126. orlNoNecessary equ $00000001            ; dont care if not opened
  127.  
  128.  ENUM 1
  129.  EITEM rt_Library            ; resource type is library
  130.  EITEM rt_TrapVector            ; resource type is trap vector
  131.  EITEM rt_Device            ; resource type is device
  132.  EITEM rt_Handler            ; resource type is handler
  133.  EITEM rt_Resource            ; resource type is resource
  134.  EITEM rt_DataType            ; resource type is datatype
  135.  ENUM 1024
  136.  EITEM rt_User1                ; User type. Needs user open/close
  137.  EITEM rt_User2
  138.  EITEM rt_User3
  139.  EITEM rt_User4
  140.  EITEM rt_User5
  141.  EITEM rt_User6
  142.  EITEM rt_User7
  143.  EITEM rt_User8
  144.  
  145.  
  146.  
  147. ***
  148. ***  Main Patch Structure
  149. ***
  150.  
  151.  STRUCTURE mps,0
  152.     APTR  mps_Next            ; pointer to next patch
  153.     APTR  mps_Prev            ; pointer to prev patch
  154.     APTR  mps_Pri                       ; priority, less runs first
  155.     APTR  mps_Patcher            ; pointer to parent Patcher
  156.     APTR  mps_PatchIDString        ; listview entry
  157.     APTR  mps_PurposeString        ; pointer to purpose string
  158.     LONG  mps_ID            ; id of resource to be patched
  159.     LONG  mps_Flags            ; flags
  160.     LONG  mps_Status            ; status of flags
  161.     LONG  mps_Offset            ; offset to change
  162.     FPTR  mps_New            ; pointer to new routine
  163.     FPTR  mps_Old            ; pointer to old routine
  164.     FPTR  mps_pns            ; pointer to pns structure
  165.     FPTR  mps_NotifyDisable        ; notified when enabled/disabled
  166.     FPTR  mps_Install            ; install rout for user type
  167.     FPTR  mps_Remove            ; uninstall rout for user type
  168.     FPTR  mps_Init            ; pointer to init routine
  169.     FPTR  mps_Exit            ; pointer to exit routine
  170.     APTR  mps_pls            ; pointer to pls structure
  171.     LONG  mps_User1            ;
  172.     LONG  mps_User2            ;
  173.     LONG  mps_User3            ;
  174.     LONG  mps_User4            ;
  175.     LABEL mps_SIZEOF
  176.  
  177.  
  178. mpsIDStringLen    equ    27
  179.  
  180. mpsDisableable    equ    $00000001    ; Enable disable patch option
  181. mpsFullPatch    equ     $00000002       ; if full, don't call orig. patch
  182. mpsDisTemp      equ     $00000004       ; While removed, previous status
  183.  
  184.  
  185.  
  186. ***
  187. ***  Patch node struct
  188. ***
  189.  
  190.  STRUCTURE pns,0
  191.     WORD  pns_Jsr            ; jsr ($4eb9)
  192.     APTR  pns_New            ; newrout
  193.     WORD  pns_Jmp            ; jmp ($4ef9)
  194.     APTR  pns_Next            ; nextrout
  195.     APTR  pns_Prev            ; pointer to prev node
  196.     APTR  pns_Pri                       ; pri, less first
  197.     APTR  pns_Orig            ; orginal routine
  198.     APTR  pns_Patch            ; pointer to main patch
  199.     APTR  pns_Patcher            ; pointer to patcher
  200.     LONG  pns_Mark                      ; $fc263815
  201.     APTR  pns_pns                       ; pointer to this structure
  202.     LONG  pns_User1            ;
  203.     LONG  pns_User2            ;
  204.     LABEL pns_SIZEOF
  205.  
  206.  
  207.  
  208. ***
  209. ***  UPS Message
  210. ***
  211.  
  212.  STRUCTURE um,MN_SIZE
  213.     LONG  um_Command            ; command to execute
  214.     LONG  um_A0                ; adress register 0
  215.     LONG  um_A1                ; adress register 1
  216.     LONG  um_A2                ; adress register 2
  217.     LONG  um_A3                ; adress register 3
  218.     LONG  um_D0                ; data register 0
  219.     LONG  um_D1                ; data register 1
  220.     LONG  um_D2                ; data register 2
  221.     LONG  um_D3                ; data register 3
  222.     LABEL um_SIZEOF
  223.  
  224.  
  225. umAllocUPS    equ    $00000001    ; Allocate UPS, in a0 ptr to
  226.                     ; app name
  227. umFreeUPS    equ    $00000002    ; Free UPS, in a0 ptr to app
  228.                     ; name
  229. umLoadPatcher    equ    $00000010    ; Initiate LoadPatcher routine
  230. umAddPatcher    equ    $00000015    ; Load Patcher, in a0 ptr to
  231.                     ; filename, in d0 error code
  232. umInstall    equ    $00000030    ; Install Patcher, in a0 ptr to
  233.                     ; patcher, in d0 error code
  234. umRemove    equ    $00000031    ; Remove Patcher, in a0 ptr to
  235.                     ; patcher
  236. umOpenResource    equ    $00000050    ; Open Resource, in a0 ptr to
  237.                     ; resource, in d0 return BOOL.
  238. umCloseResource    equ    $00000051    ; Close Resource, in a0 ptr to
  239.                     ; resource
  240. umInstallPatch    equ    $00000040    ; Install Patch, in a0 ptr to
  241.                     ; patch, in d0 error code
  242. umRemovePatch    equ    $00000041    ; Remove Patch, in a0 ptr to
  243.                     ; patch
  244. umEnablePatcher    equ    $00000035    ; Enable patcher in a0
  245. umDisablePatcher equ    $00000036    ; Disable patcher in a0
  246. umEnablePLink    equ    $00000037    ; Enadle patch link in a0
  247. umDisablePLink    equ    $00000038    ; Disable patch link in a0
  248. umOpenMain    equ    $00000060    ; Open Main Window
  249. umCloseMain    equ    $0000006f    ; Close Main Window
  250. umOpenPM    equ    $00000061    ; Open Patcher Manager Window
  251. umClosePM    equ    $0000006e    ; Close Patcher Man. Window
  252. umOpenLO    equ    $00000062    ; Open Library Overview Window
  253. umCloseLO    equ    $0000006d    ; Close Lib. Overview Window
  254. umSpitRequester    equ    $00000070    ; Spit requester, with text in
  255.                     ; a0
  256. umPrint        equ    $00000073    ; Print text line in a0
  257. umPrefsPatcher    equ    $00000078    ; Call prefs from Patcher in a0
  258. umPrefsPatchL    equ    $0000007a    ; Call prefs from PatchList in
  259.                     ; a0
  260. umGetLibBase    equ    $00000008    ; Get base ptr from code in d0,
  261.                     ; result in a0
  262. umGetPList    equ    $0000000a    ; Get PList ptr in a0, and
  263.                     ; PList itself in d0/d1/d2
  264. umMakeEasyPatcher equ    $0000001c    ; Make easy patcher with
  265.                     ; tagarray in a0. Pointer in
  266.                     ; a0, or null for error
  267. umFreeEasyPatcher equ    $0000001d    ; Remove easy patcher in a0.
  268. umMakeEasyPatch    equ    $0000001e    ; Add Patch to easy patcher.
  269.                     ; Pointer to tagarray in a0,
  270.                     ; and parent patcher in a1.
  271.                     ; Pointer to patch in a0, null
  272.                     ; for error.
  273. umFreeEasyPatch    equ    $0000001f    ; Remove east patch in a0.
  274. umNoFree    equ    $80000000    ; Don't free memory after
  275.                     ; processing
  276.  
  277. umLibExec    equ    $00000001
  278. umLibDOS    equ    $00000002
  279. umLibIntuition    equ    $00000003
  280. umLibGadTools    equ    $00000004
  281. umLibUtility    equ    $00000005
  282. umLibCommodities equ    $00000006
  283. umLibIcon    equ    $00000007
  284. umLibReqTools    equ    $00000008
  285. umLibLayers    equ    $00000009
  286. umLibGraphics    equ    $0000000a
  287. umLibWorkbench    equ    $0000000b
  288.  
  289. umTagNeedVer        equ    $80000001
  290. umTagPatcherName    equ    $80000002
  291. umTagCoderName        equ    $80000003
  292. umTagPatcherIDString    equ    $80000004
  293. umTagPatcherDisableable    equ    $80000005
  294. umTagPatcherPrefs    equ    $80000006
  295. umTagPatcherNoRemove    equ    $8000001b
  296. umTagNeedVersion    equ    $80000007
  297. umTagVersion        equ    $80000008
  298. umTagInit        equ    $80000009
  299. umTagExit        equ    $8000000a
  300. umTagPrefs        equ    $8000000b
  301. umTagPrefsKey        equ    $8000000c
  302. umTagResourceType    equ    $8000000d
  303. umTagResourceName    equ    $8000000e
  304. umTagResourceVersion    equ    $8000000f
  305. umTagResourceID        equ    $80000010
  306. umTagPatchPri        equ    $80000011
  307. umTagPatchPurposeString    equ    $80000012
  308. umTagPatchIDString    equ    $80000013
  309. umTagPatchOffset    equ    $80000014
  310. umTagPatchDisableable    equ    $80000015
  311. umTagPatchFullPatch    equ    $80000016
  312. umTagPatch        equ    $80000017
  313. umTagPatchNotifyDisable    equ    $80000018
  314. umTagPatchInit        equ    $80000019
  315. umTagPatchExit        equ    $8000001a       ; 1b is last
  316.  
  317.  
  318.  
  319. ***
  320. ***  Patchers List
  321. ***
  322.  
  323.  STRUCTURE psl,MLN_SIZE            ; simple node structure
  324.     APTR  psl_Segment            ; BPTR to patcher segment
  325.     APTR  psl_Patcher            ; pointer to patcher structure
  326.     LABEL psl_SIZEOF
  327.  
  328.  
  329. ***
  330. ***  Patch link structure
  331. ***
  332.  
  333.  STRUCTURE pls,0
  334.     APTR  pls_Next            ; pointer to next link
  335.     APTR  pls_Prev            ; pointer to prev link
  336.     APTR  pls_LinkIDString        ; listview string
  337.     APTR  pls_Prefs                     ; pointer to prefs routine
  338.     LONG  pls_Flags                     ; flags
  339.     LONG  pls_Status                    ; status
  340.     LABEL pls_List            ; patches
  341.  
  342. plsPrefs        equ     $00000001
  343. plsDisableable  equ     $00000002
  344. plsDisTemp      equ     $00000004       ; While removed, previous status
  345.  
  346.  
  347.     ENDC    ; UPS_I
  348.  
  349.